<?php

class duxColadaModel extends Model2
{
    public function __construct() {
        parent::__construct('duxsis.colada');
    }
    
    public function pzasVaciadas($id){
        $this->setQuery("
            SELECT * FROM vaciado
            INNER JOIN colada ON colada.Id = vaciado.idcolada
            INNER JOIN hornos ON colada.maquina = hornos.`id maq`
            WHERE colada.Id = $id AND vaciado.tipo = 'MOLDE' AND vaciado.almacen = 'B'
        ");
        return $this->_list();
    }
    
    public function pzasRechazadas($id){
        $this->setQuery("
            SELECT * FROM vaciado
            INNER JOIN colada ON colada.Id = vaciado.idcolada
            INNER JOIN hornos ON colada.maquina = hornos.`id maq`
            WHERE colada.Id = $id AND vaciado.tipo = 'MOLDE' AND vaciado.almacen = 'R'
        ");
        return $this->_list();
    }
}

?>
